﻿using System;
using Neits.Common;
using Neits.UserService;

namespace Projecturo.Model
{
    public class TicketState : IInstanceIdentifier, IHasDataContext, ICreated, IChanged, IName
    {
        public virtual long Id { get; set; }
        public virtual String Name { get;set; }
        public virtual String Color { get;set; }
        public virtual Project Project { get; set; }
        public virtual bool IsActive { get; set; }
        public virtual IDataContext DataContext { get; set; }
        public virtual DateTime CreateDate { get;set; }
        public virtual IUser CreatedBy { get;set; }
        public virtual DateTime ChangeDate { get;set; }
        public virtual IUser ChangedBy { get; set; }

        public TicketState Clone()
        {
            var state = new TicketState()
                                    {
                                        Name = Name,
                                        Color = Color,
                                        IsActive = true,
                                        DataContext = DataContext,
                                        CreateDate = DateTime.Now,
                                        CreatedBy = CreatedBy,
                                        ChangeDate = DateTime.Now,
                                        ChangedBy = ChangedBy
                                    };
            return state;
        }
    }
}
